package com.weixing.mall.provider.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.base.orm.MPage;
import com.weixing.mall.provider.api.model.enums.OrderTypeEnum;
import com.weixing.mall.provider.model.domain.Order;
import com.weixing.mall.provider.model.query.*;
import com.weixing.mall.provider.model.query.agent.AgentOrderStatisticQuery;
import com.weixing.mall.provider.model.vo.*;
import com.weixing.mall.provider.model.vo.agent.AbnormalOrderStatisticVo;
import com.weixing.mall.provider.model.vo.agent.AgentOrderStatisticVo;
import com.weixing.mall.provider.model.vo.agent.AgentSaleStatisticVo;
import com.weixing.mall.provider.model.vo.agent.RebateStatisticVo;
import com.weixing.mall.provider.model.vo.cliam.OrderCliamResultVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单模块-订单表 服务类
 * </p>
 *
 * @author Small
 * @since 2019-11-20
 */
public interface IAgentOrderService {
    List<FrontAgentCliamOrderVo> selectFrontAgentOrderCanClaimlist(String orderCode);

    void claimOrder(List<Order> orders);

    IPage<FrontAgentOrderVo> selectAgentOrderListOfPage(Page initMpPage, AgentOrderQuery query, Long agentId);

    Map<String,Object> selectAgentOrderListPriceTotal(AgentOrderQuery query, Long agentId);


    /**
     * 统计代理订单列表
     *
     * TODO  v2版本上线后删除
     * @param abid
     * @param type
     * @return
     */
    @Deprecated
    Map<String, Object> getFrontAgentOrderStatistics(Long abid, Integer type);

    AgentSaleStatisticVo getFrontAgentSalesStatistics(Long agentId, String type, AgentStatisticQuery query);
    AgentSaleStatisticVo getFrontAgentSalesStatistics(AgentOrderQuery query);
    AgentSaleStatisticVo getFrontAchievementStatistics(AgentOrderQuery query);

    IPage<FrontAgentOrderVo> selectAfterSaleOrderList(MPage page, AfterSaleQuery query);

    IPage<KefuAuditOrderVo> selectAgentPlaceOrderList(Page initMpPage, AgentPlaceOrderQuery query);

    RebateStatisticVo getFrontAgentprofitStatistics(Long agentId, AgentOrderQuery query);

    AbnormalOrderStatisticVo outOfStockReportStatistics(Long agentId, AgentOrderQuery query);

    AbnormalOrderStatisticVo selectExchangeStatistics(Long abid, AfterSaleQuery query);

    AbnormalOrderStatisticVo selectReturnStatistics(Long agentId, AfterSaleQuery query);

    AbnormalOrderStatisticVo canceledStatistics(AgentOrderQuery query);

    IPage<SalesAchiVo> achievement(Page initMpPage, OrderTypeEnum type, AgentOrderQuery query);

    StaticVo cntSalesOrder(int orderType,AgentOrderQuery query);

    StaticVo cntOutOfStockOrder(int orderType,AgentOrderQuery query);

    StaticVo cntCancelOrder(int orderType,AgentOrderQuery query);

    StaticVo cntReturnOrder(int orderType,AgentOrderQuery query);


    FrontAgentOrderDetilsVo selectFrontAgentOrderDetils(Long orderId, Long agentId);

    IPage<KefuAuditOrderVo> selectAuditHisList(Long aid, AgentAuditHisQuery query, Page initMpPage);

    AuditHisCntVo auditHisListSta(AgentAuditHisQuery query);

    /**
     * 根据订单识别码查询可认领订单
     *
     * @param orderSns 订单识别码，多个识别码用英文逗号隔开
     * @return 可认领详情
     */
    OrderCliamResultVo selectOrderCanClaimlist(String orderSns);

    /**
     * 代理商订单统计
     *
     * @param query 查询条件
     * @return  统计结果
     */
    AgentOrderStatisticVo orderStatistics(AgentOrderStatisticQuery query);

    IPage<FrontAgentOrderVo> selectUpPayOrderList(Page page, AgentOrderQuery query, Long agentId);


}
